"""
-*- coding: utf-8 -*-
@Author  : Link
@Time    : 2023/4/7 16:24
@Site    : 
@File    : op_interface.py
@Software: PyCharm
@Remark  : 用于继承一个OP类, 可以获取SITE的状态, 是否可以用于测试之类的
"""
from typing import List

from PySide2.QtCore import QTimer, QObject

from BenchCore.code_interface.operator_code import MultiStationStatus


class OpDeviceStatus:
    Run = 0x01
    Stop = 0x11


class OpDevice(QObject):
    uuts: List[MultiStationStatus] = None
    scan_qtimer: QTimer = None
    Status: int = None
    debug: bool = False

    def set_debug(self, on: bool = False):
        self.debug = on

    def set_dut_status(self, dut: int, status: MultiStationStatus):
        """
        设置Device的dut状态
        :param dut:
        :param status:
        :return:
        """
        pass

    def get_dut_status(self, dut: int) -> MultiStationStatus:
        """
        取走状态后, 如果是待测试, 就要将DUT的状态置于测试
        :param dut:
        :return:
        """
        pass

    def send_bin(self, dut, soft_bin: str, hard_bin: str):
        """
        送进来Bin后, SITE进入IDLE状态
        直到所有的SITE进入IDLE状态后, 才能下发Bin
        :param dut:
        :param soft_bin:
        :param hard_bin:
        :return:
        """

    def scan_handle(self):
        """
        开启扫描线程
        :return:
        """
        if self.scan_qtimer is None:
            return
